package GUI;

import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JPanel;

import Controller.InformationStation;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Font;

/**
 * this is the information station main GUI. the customer can enter his order or subscription order and can check in by this main GUI.
 * @author Or Marx
 */
public class ISMainGui extends JPanel{
	
	JFrame frame;
	JPanel lastPanel;
	public void setLastPanel (JPanel panel)
	{
		this.lastPanel=panel;
	}
	public void setFrame (JFrame frame)
	{
		this.frame=frame;
	}
	
	/**
	 * is the constructor. it has only 3 buttons that will transfer us to the right option GUI.
	 */
	public ISMainGui() {
		
		setLayout(null);
		
		JButton btnSubscriptionCheckin = new JButton("Subscription checkIn");
		btnSubscriptionCheckin.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				InformationStation is=new InformationStation();
				is.subscriptionCheckIn();
			}
		});
		btnSubscriptionCheckin.setBounds(187, 227, 153, 23);
		add(btnSubscriptionCheckin);
		
		JButton btnOrderCheckin = new JButton("Order checkIn");
		btnOrderCheckin.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				InformationStation is=new InformationStation();
				is.orderCheckIn();
			}
		});
		btnOrderCheckin.setBounds(555, 227, 153, 23);
		add(btnOrderCheckin);
		
		JButton btnOrderNowone = new JButton("order now! (one time costumer)");
		btnOrderNowone.setFont(new Font("Tahoma", Font.PLAIN, 16));
		btnOrderNowone.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				InformationStation is=new InformationStation();
				is.oneTimeCostumerOrder();
			}
		});
		btnOrderNowone.setBounds(266, 84, 351, 41);
		add(btnOrderNowone);
		
	}

}
